
#ifndef __DBGPRINT_H__
#define __DBGPRINT_H__

#include <sys/time.h>
#include "basic_datatype.h"
#include <stdio.h>



typedef enum
{
    LOG_LEVEL_DEBUG,
    LOG_LEVEL_INFO,
    LOG_LEVEL_WARNING,
    LOG_LEVEL_ERROR,
    LOG_LEVEL_NONE,
    LOG_LEVEL_BUTT,
}LOG_LEVEL_EN;


#define DEBUG 1



#define LOGD(fmt, ...)  \
    {   \
        if (LOG_LEVEL_DEBUG >= getloglevel()) \
        {   \
            printCurTime(); \
            printf("[D]  [F:%-25s:(%04d)]:  "fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__); \
        } \
    }   

#define LOGI(fmt, ...)  \
    {   \
        if (LOG_LEVEL_INFO >= getloglevel()) \
        {   \
            printCurTime(); \
            printf("[I]  [F:%-25s:(%04d)]:  "fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__); \
        } \
    }   

#define LOGW(fmt, ...)  \
    {   \
        if (LOG_LEVEL_WARNING >= getloglevel()) \
        {   \
            printCurTime(); \
            printf("[W]  [F:%-25s:(%04d)]:  "fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__); \
        } \
    }   

#define LOGE(fmt, ...)  \
    {   \
        if (LOG_LEVEL_ERROR >= getloglevel()) \
        {   \
            printCurTime(); \
            printf("[E]  [F:%-25s:(%04d)]:  "fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__); \
        } \
    }   


#endif
